"use strict";
cc._RF.push(module, '6c2a6dFpRVGKoR9q14stH7K', 'LevelLianXian20');
// scripts/modes/normalMode/levelLianXian/level20/LevelLianXian20.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var gameEngine_1 = require("../../../../engines/gameEngine");
var LevelLianXian_1_1 = require("../base/LevelLianXian_1");
var LevelLianXian_1Item_1 = require("../base/LevelLianXian_1Item");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var LevelLianXian11 = /** @class */ (function (_super) {
    __extends(LevelLianXian11, _super);
    function LevelLianXian11() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 100;
        _this.sps = [];
        _this.spNode = null;
        _this.spParamsStr = [
            ["麻烦给我的爱人来一杯Mojito", "我喜欢阅读她微醺时的眼眸", "《Mojito》"],
            ["为什么这样子", "你拉着我说你有些犹豫", "《半岛铁盒》"],
            ["我表情悠哉 跳个大概 动作轻松自在 你学不来", "霓虹的招牌 调整好状态 在华丽的城市 等待醒来", "《本草纲目》"],
            ["躺在你学校的操场看星空", "教室里的灯还亮着你没走", "《等你下课》"],
            ["谁在用琵琶弹奏", "一曲东风破", "《东风破》"],
            ["雨下整夜", "我的爱溢出就像雨水", "《七里香》"],
            ["刮风这天 我试过握着你手", "但偏偏 雨渐渐 大到我看你不见", "《晴天》"]
        ];
        return _this;
    }
    LevelLianXian11.prototype.start = function () {
        if (gameEngine_1.services().ossSrv.getPlatform() != "tt")
            this.isCountDown = false;
        _super.prototype.start.call(this);
    };
    LevelLianXian11.prototype.binGoAni = function (num, index, isLeft) {
        // this.changeTxt(index - 1);
        // this.resetSp();
        // let sp = this.spNode.getChildByName("mask").getChildByName("sp").getComponent(cc.Sprite);
        // let ani = sp.node.getComponent(cc.Animation);
        // // sp.spriteFrame = null;
        // let sps = "";
        // if(isLeft){
        //     sps = index+"_"+num;
        // }else{
        //     sps = num+"_"+index;
        // }
        // let indexNum:number = this.getSpsIndex(index);
        // sp.spriteFrame = this.sps[indexNum];
        // cc.Tween.stopAllByTarget(sp.node);
        // sp.node.opacity = 0;
        // cc.tween(sp.node).to(0.1,{opacity:255}).start();
        // ani.play("spShark");
        // let tween = cc.tween(sp.node).to(0.05,{angle:2,x:20},{easing:cc.easing.backOut}).to(0.05,{angle:x:0},{easing:cc.easing.backIn}).to(0.05,{angle:-2,x:-20},{easing:cc.easing.backOut}).to(0.05,{angle:0,x:0},{easing:cc.easing.backIn}).start();
    };
    LevelLianXian11.prototype.changeTxt = function (index) {
        var label = this.spNode.getChildByName("nameLabel");
        var label1 = this.spNode.getChildByName("nameLabel1");
        var label2 = this.spNode.getChildByName("nameLabel2");
        label.getComponent(cc.Label).string = this.spParamsStr[index][2]; //名字
        var lyric1 = this.spParamsStr[index][0];
        var lyric2 = this.spParamsStr[index][1]; //俩歌词
        label1.getComponent(cc.Label).string = lyric1;
        label2.getComponent(cc.Label).string = lyric2;
    };
    LevelLianXian11.prototype.resetSp = function () {
        var label = this.spNode.getChildByName("nameLabel");
        var label1 = this.spNode.getChildByName("nameLabel1");
        var label2 = this.spNode.getChildByName("nameLabel2");
        label.getComponent(cc.Label).string = ""; //名字置空
        label1.removeAllChildren();
        label2.removeAllChildren();
        // label1.getComponent(cc.Label).string = "";
        // label2.getComponent(cc.Label).string = "";
        // soundGol.getComponent(cc.Label).string = "";
        // soundGo2l.getComponent(cc.Label).string = "";
        // soundGo.width = 0;
        // soundGo2.width = 0;
        cc.Tween.stopAllByTarget(label1);
        cc.Tween.stopAllByTarget(label2);
    };
    LevelLianXian11.prototype.getSpsIndex = function (index) {
        var indexNum = -1;
        // let path: string = this.levelName+"/sound/" + index;
        // managers().soundMgr.stopAllSound();
        // managers().soundMgr.playSound(path);
        switch (index) {
            case "1_3":
                indexNum = 0;
                break;
            case "1_2":
                indexNum = 1;
                break;
            case "2_2":
                indexNum = 2;
                break;
            case "2_1":
                indexNum = 3;
                break;
            case "3_5":
                indexNum = 4;
                break;
            case "3_4":
                indexNum = 5;
                break;
            case "4_1":
                indexNum = 6;
                break;
            case "5_7":
                indexNum = 7;
                break;
            case "5_6":
                indexNum = 8;
                break;
            case "6_6":
                indexNum = 9;
                break;
            case "7_4":
                indexNum = 10;
                break;
        }
        this.changeTxt(indexNum);
        // this.checkWin();
        return indexNum;
    };
    LevelLianXian11.prototype.checkWin = function () {
        console.warn("??????zmhs");
        var leftNodes = this.leftNode.children;
        for (var i = 0; i < leftNodes.length; i++) {
            var n = leftNodes[i];
            if (!n.getComponent(LevelLianXian_1Item_1.default).currentWayPoint) {
                return;
            }
        }
        console.warn("??????zmhs");
        this.canTouch = false;
        this.Win(1);
        this.isStartTime = false;
        this.isPlaySound = true;
    };
    __decorate([
        property({ type: cc.SpriteFrame, displayName: "图片名字" })
    ], LevelLianXian11.prototype, "sps", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "图片节点" })
    ], LevelLianXian11.prototype, "spNode", void 0);
    LevelLianXian11 = __decorate([
        ccclass
    ], LevelLianXian11);
    return LevelLianXian11;
}(LevelLianXian_1_1.default));
exports.default = LevelLianXian11;

cc._RF.pop();